Skip to content

fix: quiet successful daemon attach logs#640

Closed
mturac wants to merge 1 commit into
colbymchenry:mainfrom
mturac:fix/issue-618-drop-undefined-daemon-log
Closed

fix: quiet successful daemon attach logs#640
mturac wants to merge 1 commit into
colbymchenry:mainfrom
mturac:fix/issue-618-drop-undefined-daemon-log

Conversation

@mturac
Copy link
Copy Markdown

@mturac mturac commented Jun 2, 2026

Summary

  • stop writing successful shared-daemon attach notices to stderr by default
  • keep the attach notice available behind CODEGRAPH_MCP_LOG_ATTACH=1 for debugging
  • update daemon regression tests to assert attach still works without noisy success stderr

Closes #618

Tests

  • npm run build
  • npm test -- __tests__/mcp-daemon.test.ts

@treytracedit-lab
Copy link
Copy Markdown

colbymchenry added a commit that referenced this pull request Jun 8, 2026
The "Attached to shared daemon" line is benign INFO, but it was written to
stderr — and MCP hosts render all server stderr at error level (and append an
`undefined` data field), so on every session start a healthy attach showed up
as `[error] … undefined`. It is now gated behind CODEGRAPH_MCP_LOG_ATTACH=1:
silent by default, opt-in for debugging daemon attach. Both attach sites
(runProxy + connectWithHello) route through one helper. The daemon integration
tests opt the harness into the log so their attach assertions still observe a
successful attach.

Re-applies the approach from #640 by @mturac.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@colbymchenry
Copy link
Copy Markdown
Owner

Thanks @mturac — clean, well-targeted fix. 🙏

I've landed it as #725, rebased onto current main: this PR had drifted out of date (#724 and the recent shared-daemon reworks both touched proxy.ts and mcp-daemon.test.ts, so it went conflicting). #725 keeps your exact approach — a logAttachedDaemon() helper gated behind CODEGRAPH_MCP_LOG_ATTACH=1, routing both attach sites (runProxy + connectWithHello) through it — plus a small unit test and a harness opt-in so the existing daemon attach assertions still pass. You're credited in the commit and the CHANGELOG.

Closing in favor of #725. Appreciate you catching this one!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[error] [CodeGraph MCP] Attached to shared daemon on /Users/xxx/.codegraph/daemon.sock (pid 12163, v0.9.8). undefined

3 participants